package com.zcplatform.crowd.controller;

import com.zcplatform.crowd.dto.Student;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class TestHandler {

    @RequestMapping(value = "/hello/haha.html")
    public String doTest(){
        return "target";
    }

    @ResponseBody
    @RequestMapping(value = "send/compose/object.json",method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
    public String testAjax(@RequestBody Student student){
        System.out.println(student);
        return "target";
    }
}
